package com.learn.flink.learn.transformation;

import org.apache.flink.api.common.functions.Partitioner;

public class MyPartitioner implements Partitioner<Long> {

    @Override
    public int partition(Long key, int i) {
        System.out.println("一共有" + i + "个分区");
        if (key % 2 == 0) {
            return 0;
        }
        return 1;
    }
}
